const std = @import("std");

pub const LengthUnitsPerMeter: f32 = 1.0;

/// Used to detect bad values. Positions greater than about 16km will have precision
/// problems, so 1000km as a limit should be fine in all cases.
pub const Huge: f32 = 1000000.0 * LengthUnitsPerMeter;

/// A small length used as a collision and constraint tolerance. Usually it is
/// chosen to be numerically significant, but visually insignificant. In meters.
/// Normally this is 0.5cm.
/// @warning modifying this can have a significant impact on stability
pub const LinearSlop: f32 = 0.005 * LengthUnitsPerMeter;

/// The maximum rotation of a body per time step. This limit is very large and is used
/// to prevent numerical problems. You shouldn't need to adjust this.
/// @warning increasing this to 0.5f * pi or greater will break continuous collision.
pub const MaxRotation: f32 = 0.25 * std.math.pi;

/// Box2D uses limited speculative collision. This reduces jitter.
/// Normally this is 2cm.
/// @warning modifying this can have a significant impact on performance and stability
pub const SpeculativeDistance: f32 = 4.0 * LinearSlop;

/// This is used to fatten AABBs in the dynamic tree. This allows proxies
/// to move by a small amount without triggering a tree adjustment. This is in meters.
/// Normally this is 5cm.
/// @warning modifying this can have a significant impact on performance
pub const AABBMargin: f32 = 0.05 * LengthUnitsPerMeter;

/// The time that a body must be still before it will go to sleep. In seconds.
pub const TimeToSleep: f32 = 0.5;
